package com.wwtech.epp.ui.activity.main.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.entity.WorkCategory;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.main.WorkFragment;
import com.wwtech.epp.ui.activity.main.contract.WorkContract;
import com.wwtech.epp.ui.activity.main.presenter.WorkPresenter;
import com.wwtech.epp.ui.adapter.main.WorkCategoryAdapter;

import java.util.ArrayList;
import java.util.List;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.main
 * @Description: The moduele of WorkFragment, provide field for WorkFragment
 * @date 2017/08/21 11:14:20
 */
@Module
public class WorkModule {
    private final WorkContract.View mView;


    public WorkModule(WorkContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public WorkPresenter provideWorkPresenter(HttpAPIWrapper httpAPIWrapper, WorkFragment mFragment) {
        return new WorkPresenter(httpAPIWrapper, mView, mFragment);
    }

    @Provides
    @ActivityScope
    public WorkFragment provideWorkFragment() {
        return (WorkFragment) mView;
    }

    @Provides
    @ActivityScope
    public List<WorkCategory.DataBean> provideList() {
        List<WorkCategory.DataBean> list = new ArrayList<>();
        return list;
    }

    @Provides
    @ActivityScope
    public WorkCategoryAdapter provideWorkCategoryAdapter(List<WorkCategory.DataBean> list) {
        return new WorkCategoryAdapter(list);
    }
}